Component({
  properties: {
    address: {
      type: Object,
      value: {},
    },
    index: {
      type: Number,
      value: 0,
    }
  },

  methods: {
    onDel({currentTarget}) {
      const item = {
        id: currentTarget.dataset.id,
        index: currentTarget.dataset.index
      }
      this.triggerEvent('onDelete', item);
    },
    onEdit(e) {
      const { item } = e.currentTarget.dataset;
      this.triggerEvent('onEdit', item);
    },
    setDefault( {currentTarget} ) {
      const item = {
        id: currentTarget.dataset.id,
        index: currentTarget.dataset.index
      }
      this.triggerEvent('setDefault', item);
    },
    onSelect(e) {
      const { item } = e.currentTarget.dataset;
      this.triggerEvent('onSelect', item);
    }
  },
});
